#!/bin/bash

# wellcome
clear
echo "uScid 0.0.1"
echo "-----------"


# retrive account
user=$1
read -s -p "enter password: " pass
echo ""

# retrive account information
mkdir /home/totalinnovation/.uscid/user/$user 
mkdir /home/totalinnovation/.uscid/user/$user/setting/ 

# copy from .uscid/user/$user to .scid
cp -R -f /home/totalinnovation/.uscid/user/$user/setting/* /home/totalinnovation/.scid/

# launch service
echo " - account: $user"
echo " - launch Scid"
cd /home/totalinnovation/.uscid/user/$user/
#scid

# copy from .scid to .uscid/user/$user
cp -R -f /home/totalinnovation/.scid/* /home/totalinnovation/.uscid/user/$user/setting/
cd /home/totalinnovation/.uscid/user/
tar -zcvf /home/totalinnovation/.uscid/temp/$user.tar.gz $user/ \
	>> uscid-$user.log

# post user data on service
curl \
	-F \
	file="@/home/totalinnovation/.uscid/temp/$user.tar.gz" \
	http://javanile.org/uscid/ \
	>> uscid-$user.log

